package com.commerceerp.system.service.Impl;

import com.commerceerp.system.mapper.FxClassLevelMapper;
import com.commerceerp.system.service.FxClassLevelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class FxClassLevelServiceImpl implements FxClassLevelService {

    @Autowired
    private FxClassLevelMapper fxClassLevelMapper;


    @Override
    public Integer addOneLevelMenu(String oneLevelName, String oneLevelSort) {

        Integer success = this.fxClassLevelMapper.addOneLevelMenu(oneLevelName,oneLevelSort);

        return success;
    }

    @Override
    public Integer updateOneLevelMenu(String oneLevelName, String oneLevelSort,String oneLevelId) {
        Integer success = this.fxClassLevelMapper.updateOneLevelMenu(oneLevelName,oneLevelSort,oneLevelId);

        return success;
    }

    @Override
    public List<Map> getAllOneLevelMenu() {

        List<Map> list = this.fxClassLevelMapper.getAllOneLevelMenu();

        return list;
    }

    @Override
    public Integer delteOneLevelMenu(String oneLevelId) {
        Integer success = this.fxClassLevelMapper.delteOneLevelMenu(oneLevelId);

        return success;
    }

    @Override
    public Integer addTwoLevelMenu(String twoLevelName, String twoLevelSort, String oneLevelId, String commision) {
        Integer success = this.fxClassLevelMapper.addTwoLevelMenu(twoLevelName,twoLevelSort,oneLevelId,commision);

        return success;
    }

    @Override
    public Integer updateTwoLevelMenu(String twoLevelName, String twoLevelSort, String oneLevelId, String commision,String twoLevelId) {
        Integer success = this.fxClassLevelMapper.updateTwoLevelMenu(twoLevelName,twoLevelSort,oneLevelId,commision,twoLevelId);

        return success;
    }

    @Override
    public List<Map> getAllTwoLevelMenu(String oneLevelId) {

        List<Map> list = this.fxClassLevelMapper.getAllTwoLevelMenu(oneLevelId);

        return list;
    }

    @Override
    public Integer delteTwoLevelMenu(String twoLevelId) {
        Integer success = this.fxClassLevelMapper.delteTwoLevelMenu(twoLevelId);

        return success;
    }
}
